package com.glory.brepda.adapter;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.glory.brepda.R;
import com.glory.brepda.activity.check.QCDetailActivity;
import com.glory.brepda.entity.QCCheckBean;
import com.glory.brepda.entity.QCCheckProgressBean;

import org.apache.commons.lang3.StringUtils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class QCCheckProgressAdapter extends BaseQuickAdapter<QCCheckProgressBean.QcMaintenanceProgressList, BaseViewHolder> {

    private Activity activity;

    public QCCheckProgressAdapter(@Nullable List<QCCheckProgressBean.QcMaintenanceProgressList> data, Activity activity) {
        super(R.layout.adapter_qc_progress_check,data);
        this.activity = activity;
    }

    @Override
    protected void convert(BaseViewHolder helper, QCCheckProgressBean.QcMaintenanceProgressList item) {

        helper.setText(R.id.tvItemName,item.getITEM_NAME());
        helper.setText(R.id.tvItemDescribe,item.getITEM_DESC());
        if("OK".equals(item.getRESULT())){
            helper.setText(R.id.tvIsComplete,"已完成");
        }else{
            helper.setText(R.id.tvIsComplete,"未完成");
        }

        if("tech_timing".equals(item.getROLE())){//操作角色
            helper.setText(R.id.tvOperateRole,"技术员");
        }else if("op_timing".equals(item.getROLE())){
            helper.setText(R.id.tvOperateRole,"op");
        }else if("qc_timing".equals(item.getROLE())){
            helper.setText(R.id.tvOperateRole,"qc");
        }else{
            helper.setText(R.id.tvOperateRole,"");        }

        helper.setText(R.id.tvGroup,item.getUSER_GROUP());
    }



}
